<?php  # Script -- foreach.php

/* Author @ Huoty
 *   Date @ 2015-03-11 14:56:17
 *  Brief @ 
 */

$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
    $value = $value * 2;
}
// $arr is now array(2, 4, 6, 8)

foreach ($arr as $val)
{
    echo $val . "<br>";
}

unset($value); // 最后取消掉引用

?>
